Repository navigation
fix(libc): return the bad_alloc and bad_function_call what() strings of the libc.prx titles ship - #11213
Conversation
|
Windows and Linux runs of head
AI-assisted: yes (Claude Code); results above were run on this machine. |
MarcZX10
left a comment
There was a problem hiding this comment.
The bundled libc.prx vtable/string evidence is specific, and the changed mapping plus expectation updates are small. I am not approving this submitted head yet because it is based on 88f9967, while current main is 3fea2a9. Since that base, main changed StandardExceptions.cpp and the guest exception tests this PR edits (including the SCE v2 test-overread fix). The current diff therefore has not been checked against the current implementation and fixtures.
Please rebase onto current main, rerun the affected exception tests on that tree, and report the MinGW-only guest_message_destructor_abi result if the Windows check can execute it. I found no independent defect in the small string mapping itself; this request is for current-tree integration and repeatable test evidence under the repository's branch-currency rule.
…of the libc.prx titles ship
e529021 to
edeac65
Compare
|
@MarcZX10 Rebased onto
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head edeac65600f4bc780320905a47f43b8c5bfb029c against current main 2ee8e9751a06bd4cb7edb8d17f433d56a39a7025.
The three PlainWhat mappings match the strings documented from PPSA21564's bundled libc.prx; bad_array_new_length correctly shares bad_alloc's bad allocation text. The updated guest test expectations match those outputs, while the existing __sce_v2 bad-function-call mapping remains unchanged. I found no issue in the changed paths. The overlap scan reports no open-PR overlap; the current-main merge preview is clean, and none of the intervening main commits changes these three paths.
Local verification: Release build of guest_sce_v2_exceptions_tests, guest_bad_optional_access_tests, and exception_runtime_tests succeeded. Those three CTests passed three repetitions each (9/9). check_conventions.py and git diff --check passed. Hosted Windows, Ubuntu relinker, Ubuntu register-context, ASan relinker, conventions, eligibility, intake, labels, and report checks pass; Linux product is skipped, and macOS jobs remain queued. I could not run the MinGW-only guest_message_destructor_abi on this Linux host; hosted Windows does not build that guest-linked test. No PS5 title run was performed.
|
Follow-up to my review: both previously queued macOS relinker checks have now completed successfully. The hosted checks for this head are green, with the Linux product job skipped by the workflow path filters. The MinGW-only |
BunnyFl
left a comment
There was a problem hiding this comment.
Approving head edeac65600. I read the diff and ran firmware 13.42's std::bad_alloc::what (xvRvFtnUk3E) and std::bad_function_call::what (XVu4--EWzcM): the decrypted system libSceLibcInternal.sprx's exports, natively on a PC (not a console). Three identical runs.
They return "bad allocation" and "bad function call", the strings this change uses (the updated tests check the bad allocation one), so the system module agrees with the PPSA21564 libc.prx reading in the description. I did not check bad_array_new_length's vtable or the unchanged classes in the module.
|
@MarcZX10 The approved head edeac65 still merges cleanly into current |
What
std::bad_alloc,std::bad_array_new_lengthandstd::bad_function_callreturnedstd::bad_alloc,std::bad_array_new_lengthandstd::bad_function_callfromwhat(). Thelibc.prxthat PPSA21564 bundles (sce_module/libc.prx, the library's own code) returnsbad allocation,bad allocationandbad function call. Every vtable below was resolved through the module'sR_X86_64_RELATIVErelocations, read from the disassembly, not measured:what()in thatlibc.prxstd::bad_allocbad allocation(_ZNKSt9bad_alloc4whatEv, 0x16fa0)std::bad_allocstd::bad_array_new_lengthbad allocation(its vtable points atbad_alloc::what)std::bad_array_new_lengthstd::bad_function_callbad function call(0x177d0)std::bad_function_callstd::bad_cast,std::bad_typeidstd::bad_cast,std::bad_typeidstd::bad_weak_ptr,std::bad_variant_accessbad_weak_ptr,bad_variant_accessThe library's
__sce_v2bad_function_callalready returnedbad function call. The_Xbad_alloccase ofguest_sce_v2_exceptionsand the plainwhatmode ofguest_message_destructor_abi, which expected the oldbad_allocstring, now expectbad allocation.Not changed here:
libc.prx,std::exception::what(0x17040) returns an empty string.std::bad_exceptionandstd::bad_optional_accessdon't override it (their vtables point at it), so they return it too.std::exception,St13bad_exceptionandbad_optional_access.what()forstd::exception, so these three are left for a follow-up.bad_variant_accessandbad_optional_accessare not edited here, because four open PRs change the lines around them.Tested
Ubuntu 24.04 (WSL2), GCC 13.3, Release build with
BUILD_TESTING=ON, head edeac65 onmain1089f2b. Thatmainhas thefuture_error/error_category(#11241) andunderflow_error(#10608) exports inStandardExceptions.cppand the SCE v2 test-overread fix (#10829):guest_sce_v2_exceptions,guest_bad_optional_accessandexception_runtimepass 3 runs each, as doexception_personality,exception_c_cleanup,host_libstdcxx_exceptionandunwind_callback_abi_delete_exception.guest_message_destructor_abiis built only with MinGW, so I did not run it, and the hosted Windows job cannot either: on pull requests it only links the host-only tests, and this one links the guestlibc. Its expected string is updated the same way.python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.py --branch fix/libc-exception-what-stringsfinds no overlap. feat(libc): implement std::_Throw(const std::bad_array_new_length&) #10927 addsstd::_Throw(const std::bad_array_new_length&), and its test does not check the string.No title run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)